package cn.aib.educms.controller;


import cn.aib.commonutils.R;
import cn.aib.educms.entity.CrmBanner;
import cn.aib.educms.service.CrmBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/educms/bannerfront")
//@CrossOrigin
public class BannerFrontController {
    @Autowired
    private CrmBannerService crmBannerService;
    /**
     *  查询所有banner
     *  方法名：getAllBanner
     *  参数：无
     *  返回值：R
     */
    @GetMapping("/cms/getAllBanner")
    public R getAllBanner(){

        //查询
        List<CrmBanner> list = crmBannerService.getAllBanner();

        //返回
        return R.ok().data("list",list);
    }
}
